package com.gomtel.smartdevice.ui.holder;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import com.gomtel.smartdevice.R;
import com.gomtel.smartdevice.base.BasicHolder;
import com.gomtel.smartdevice.global.WatchApplication;
import com.gomtel.smartdevice.moudle.db.entity.EcgDataInfo;

/**
 * Created by Administrator on 2018/5/26 0026.
 */

public class EcgDataHolder extends BasicHolder<Object> {

    private Context context;
    private TextView view_1;
    private TextView view_2;
    private TextView view_3;
    private TextView view_4;
    private TextView view_5;

    public EcgDataHolder(Context context) {
        this.context = context;
    }

    @Override
    public View initHolderView() {
        View view = View.inflate(WatchApplication.getInstance(), R.layout.item_ecg_data, null);
        view_1 =(TextView) view.findViewById(R.id.view_1);
        view_2 =(TextView) view.findViewById(R.id.view_2);
        view_3 =(TextView) view.findViewById(R.id.view_3);
        view_4 =(TextView) view.findViewById(R.id.view_4);
        view_5 =(TextView) view.findViewById(R.id.view_5);
        return view;
    }

    @Override
    public void bindData(Object data) {
        EcgDataInfo ecgDataInfo = (EcgDataInfo) data;
        view_1.setText(ecgDataInfo.getHRVStatus());
        view_2.setText(ecgDataInfo.getBiologicalAge());
        view_3.setText(ecgDataInfo.getPressureExponent());
        view_4.setText(ecgDataInfo.getTiredExponent());
        view_5.setText(ecgDataInfo.getRecentlyTime());
    }

}
